package behavioral.visitor;

/**
 * @ClassName: MyVisitor
 * @Description: 具体的访问者类
 * @Author: liu-hao
 * @Date: 2023-04-10 22:58
 * @Version: 1.0
 **/
public class MyVisitor implements Visitor {
    @Override
    public void visit(Book book) {
        System.out.println("Book - Title: " + book.getTitle() + ", Author: " + book.getAuthor());
    }

    @Override
    public void visit(DVD dvd) {
        System.out.println("DVD - Title: " + dvd.getTitle() + ", Director: " + dvd.getDirector());
    }
}